﻿WinJS.Namespace.define("Texture", {
    CreateFromImage: function (ImageSource) {
        var _Texture = new THREE.Texture();
        var loader = new THREE.ImageLoader();

        loader.addEventListener('load', function (event) {

            _Texture.image = event.content;
            _Texture.needsUpdate = true;

        });
        loader.load(ImageSource);

        return new THREE.MeshBasicMaterial({ map: _Texture });
    }
});